<template>
  <a-sub-menu
      v-if="menu.children && menu.children.length >= 1"
      :key="menu.path"
  >
    <template #title>
      <span>
        <AppstoreOutlined/>
        <span>{{menu.name}}</span>
      </span>
    </template>
    <sub-menu
        v-for="item in menu.children"
        :key="item.path"
        :menu="item"
    ></sub-menu>
  </a-sub-menu>
  <a-menu-item v-else :key="menu.path">
    <span>{{menu.name}}</span>
  </a-menu-item>
</template>

<script lang="ts">

import { defineComponent } from "vue";
import {
  AppstoreOutlined,
} from "@ant-design/icons-vue";
export default defineComponent({
  name: "sub-menu",
  setup: (props) => {
    console.log(props.menu, '调用');
    return { };
  },
  props: {
    menu: {
      type: Object,
      required: true
    }
  },
  components: {
    SubMenu: () => import('./main-sidebar-sub-menu.vue'),
    AppstoreOutlined
  }
});
</script>

<style scoped>

</style>
